<?php
	header("Content-Type: text/html;charset=utf-8");
	include("function/_nosql.php"); //
	include("function/function.php");
	$kboy_userid = $_SESSION['kboy_userid'];
	$kboy_user = $_SESSION['kboy_user'];
	
	$uid = chkstr(trim($_REQUEST['uid']));
	$ac = chkstr(trim($_REQUEST['ac']));
	if(empty($uid)){
		echo erro("参数错误");
	}
	if(!is_numeric($uid)){
		echo erro("参数错误");
	}
	if(getNewsNums("kboy_user","uid=$uid") <1){
		echo erro("参数错误");
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>我的相册_社区_<?= $web_titles ?></title>
<meta name="Keywords" content="我的相册,社区,<?= $web_keywords ?>" />
<meta name="Description" content="<?= $web_description ?>" />
<link rel="stylesheet" href="css/common.css"/>
<link rel="stylesheet" href="css/sq.css"/>
<script type="text/javascript" src="js/baidutongji.js"></script>
<script type="text/javascript" src="js/laydate/laydate.js"></script>
</head>
<body>
    <!--top-bar begin-->
	<? include("_include.top.topbar.php") ?>
    <!--top-bar end-->
    <!--header begin-->
	<? include("_include.top.navbar.php") ?>
    <!--header end-->
    <!--banner begin-->
	<? include("_include.forum.banners.php") ?>
    <!--banner end-->
    <!--活动 begin-->
    <div class="sq-wrap">
		<? include("_include.forum.title.php") ?>
        <div class="sq-bd">
			<? include("_include.forum.topnav.php") ?>
            <div class="sq-bd-con">
                <div class="sq-bd-l">
                    <div class="sq-photo-wrap">
						
						
					<?php
							if($kboy_userid == $uid){
					?>
                        <div class="travel-hd">
                            <div class="title">我的相册</div>
                            <div class="yj-num"><span><?=getNewsNums("kboy_forum_album","1=1 and uid=$kboy_userid")?></span>个相册</div>
                            <div class="write-yj"><a href="forum_photo_albumadd.php?uid=<?=$uid?>">创建相册</a></div>
                        </div>
					<?php
							}
					?>
						
						
						
                        <div class="hd-top-nav">
                            <ul>
                                <li<? if($ac==""){ echo " class=\"on\"";}?>><a href="forum_photo.php?uid=<?=$uid?>">全部照片</a></li>
                                <li<? if($ac=="1"){ echo " class=\"on\"";}?>><a href="forum_photo.php?uid=<?=$uid?>&ac=1">最近三个月</a></li>
                                <li<? if($ac=="2"){ echo " class=\"on\"";}?>><a href="forum_photo.php?uid=<?=$uid?>&ac=2">最近1年</a></li>
                                <li<? if($ac=="3"){ echo " class=\"on\"";}?>><a href="forum_photo.php?uid=<?=$uid?>&ac=3">1年前</a></li>
                                <div class="hd-total">共计<span><?=getNewsNums("kboy_forum_album","1=1 and uid=$kboy_userid")?></span>个相册</div>
                            </ul>
                        </div>
                        <div class="bd-d-content">
                            <ul class="hd-pic-list clearfix">
							
						<?php
								$SQL = "";
								$pagesize = 10; // 分页数量
								$pageval = chkstr(trim($_REQUEST['page'])); // 获取Page的值
								if($pageval){
									if(!is_numeric($pageval)){
										echo erro("Page Error");
									}
									if($pageval <= 1){
										$pageval = 1;
									}
									$page = ($pageval-1) * $pagesize;
									$page .= ",";
								}else{
									$pageval = 1;
								}
								
								if($ac == "1"){
									$pagesql = "select * from kboy_forum_album where uid=$uid order by id desc";
								}elseif($ac == "2"){
									$pagesql = "select * from kboy_forum_album where uid=$uid order by id desc";
								}else{
									$pagesql = "select * from kboy_forum_album where uid=$uid order by id desc";
								}
								$pagenum = mysql_num_rows(mysql_query($pagesql)); // 总记录数
								$pagecount = ceil($pagenum/$pagesize); // 共分多少页
								if($pageval > $pagecount){
									$pageval = $pagecount;
								}
								
								$news_sql = $pagesql." limit $page $pagesize";
								$news_rows = mysql_query($news_sql);
								$i = 1;
								while($news_rs = mysql_fetch_array($news_rows)){
						?>
                                <li>
                                    <a href="forum_photo_pic.php?uid=<?=$uid?>&aid=<?=$news_rs['id']?>">
                                        <div class="pic">
                                            <img src="<?=getClassName("kboy_forum_pic","photo_pic","uid=$uid and aid=".$news_rs['id']." and photo_face=1")?>" width="336" height="182" alt=""/>
                                            <div class="pic-info">
                                                <div class="inner">
                                                    <p class="title">相册描述</p>
                                                    <p class="ms"><?=$news_rs['album_text']?></p>
                                                    <p class="more">点击查看照片&gt;&gt;</p>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="info"><?=$news_rs['album_title']?><span class="date"><?=date('Y-m-d',strtotime($news_rs['album_shoottime']))?></span></div>
                                    </a>
                                </li>
						<?php
								} // while 完毕
						?>
                            </ul>
						<?php
								if($pagenum > $pagesize){
									echo "<div class=\"pagination\"><ul>";
									$url = "forum_photo.php?uid=$uid";//当前页面
									pagebar($pagecount, $pageval, 7, $url);
									echo "</ul></div>";
								}
						?>
                        </div>
                    </div>
                </div>
				
				
				
				<? include("_include.forum.right.php") ?>
				
				
            </div>
        </div>
    </div>
    <!--foot begin-->
	<? include("_include.bottom.footbar.php") ?>
    <!--foot begin-->
    <!--左侧悬浮 begin-->
	<? include("_include.bottom.leftbar.php") ?>
    <!--左侧悬浮 end-->
    <!--右侧悬浮导航 begin-->
	<? include("_include.bottom.rightbar.php") ?>
    <!--右侧悬浮导航 end-->
    <script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="js/jquery.SuperSlide.2.1.1.js"></script>
    <script type="text/javascript" src="js/main.js"></script>
    <script type="text/javascript" src="js/sq.js"></script>
</body>
</html>

